<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
				 java.util.ArrayList" %>
<%@ page import="com.scalar.chiptrack.users.Functionality"%>
<%@ page import="com.scalar.chiptrack.users.User"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<chiptrack:checkLogon sourcePage="/tapeReelRequest.do"/>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>
<HTML>
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>

<script language="javascript">

function openCalendar(dateValue)
{
    dateElement = dateValue;
	newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
	newWindow.moveTo(550,180);
	newWindow.focus();
}

function assignDate(passedValue)
{
	dateElement.value=passedValue;
	window.focus();
}

/*code for restricting the user to enter numbers and decmals*/
function numcheck()
{
	if(((event.keyCode<48)||(event.keyCode>57)))
	{
		if(event.keyCode==46)
		{
			event.keyCode=0;
		}
		else
		{
			event.keyCode=0;
		}
	}
}

function setSelectAllIds( Object, idx)
{
    if( document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].checked'].checked == true )
    {
        document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].pulledQty'].disabled = false;
        document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].pulledQty'].value = document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].availableQty'].value;
        document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].trQty'].disabled = false;
		document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].returnQty'].disabled = false;
    }
    else
    {
        document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].pulledQty'].value = '0';
        document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].trQty'].value = '0';
		document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].returnQty'].value = '0';
        document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].pulledQty'].disabled = true;
        document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].trQty'].disabled = true;
		document.tapeReelRequestForm['tapeReelRequest.lotList['+idx+'].returnQty'].disabled = true;
    }

}

function calculateRunningTotal()
{
	var form = document.tapeReelRequestForm;
	var runningTotalTRCtrl = form['runningTotalTRQty'];
	var runningTotalPulledCtrl = form['runningTotalPulledQty'];
	var runningTotalReturnCtrl = form['runningTotalReturnQty'];
	var runningTotalRejectCtrl = form['runningTotalRejectQty'];
	var totalTRQty = 0	
	var totalPulledQty = 0;
	var totalReturnQty = 0;
	var totalRejectQty = 0;

    if( typeof lotNumberListSize != "undefined" && lotNumberListSize >= 0 )
    {
        for ( var i = 0; i < lotNumberListSize; i++ )
        {
            var trQtyCtrl = document.tapeReelRequestForm['tapeReelRequest.lotList['+i+'].trQty'];
            var pulledQtyCtrl = document.tapeReelRequestForm['tapeReelRequest.lotList['+i+'].pulledQty'];
            var returnQtyCtrl = document.tapeReelRequestForm['tapeReelRequest.lotList['+i+'].returnQty'];
			var rejectQtyCtrl = document.tapeReelRequestForm['tapeReelRequest.lotList['+i+'].rejectQty'];
            totalPulledQty = totalPulledQty + Number(pulledQtyCtrl.value);
            totalTRQty = totalTRQty + Number(trQtyCtrl.value);
            totalReturnQty = totalReturnQty + Number( returnQtyCtrl.value );
			totalRejectQty = totalRejectQty + Number( rejectQtyCtrl.value );
        }
        runningTotalTRCtrl.value = totalTRQty;
        runningTotalPulledCtrl.value = totalPulledQty;
        runningTotalReturnCtrl.value = totalReturnQty;
		runningTotalRejectCtrl.value = totalRejectQty;
    }
}

function createRequest()
{
    var errors = "";
    var reqDate = document.tapeReelRequestForm['tapeReelRequest.reqDate'];

    if( chkDate(reqDate.value.trim(),"Req Date ","Y") == false)
    {
        errors = errMsg;
        reqDate.select();
        reqDate.focus();
    }
    if( document.tapeReelRequestForm['tapeReelRequest.reelQty'].value == '' )
    {
        errors = errors + "<li>Enter Reel Qty";
    }
    if( document.tapeReelRequestForm['tapeReelRequest.reqQty'].value == '' )
    {
        errors = errors + "<li>Enter Req Qty";
    }

    if( typeof lotNumberListSize != "undefined" && lotNumberListSize >= 0 )
    {
        for ( var i = 0; i < lotNumberListSize; i++ )
        {
           var lotCheckCtrl = document.tapeReelRequestForm['tapeReelRequest.lotList[' + i + '].checked'];
           var pulledQty    = document.tapeReelRequestForm['tapeReelRequest.lotList[' + i + '].pulledQty'].value;
           var lotNumber    = document.tapeReelRequestForm['tapeReelRequest.lotList[' + i + '].lotNumber'].value;
           var availQty     = document.tapeReelRequestForm['tapeReelRequest.lotList[' + i + '].availableQty'].value;
           var trQty        = document.tapeReelRequestForm['tapeReelRequest.lotList[' + i + '].trQty'].value;

           if( lotCheckCtrl.checked && pulledQty == 0 )
           {
                errors = errors + "<li>Please Enter Pulled Qty for Lot Number:"+ lotNumber +"</li>"
           }
           /*if( lotCheckCtrl.checked && trQty == 0 )
           {
                errors = errors + "<li>Please Enter T&R Qty for Lot Number:"+ lotNumber +"</li>"
           }*/
           if( pulledQty != "" && trQty != "" && parseInt(trQty) > parseInt(pulledQty ) )
           {
                errors = errors + "<li>T&R Qty Cannot be Greater than Pulled Qty for Lot Number:"+ lotNumber +"</li>"
           }
           if( pulledQty != "" && trQty != "" && parseInt(pulledQty) > parseInt(availQty ) )
           {
                errors = errors + "<li>Pulled Qty Cannot be Greater than Available Qty for Lot Number:"+ lotNumber +"</li>"
           }
        }
    }
    /*if(document.tapeReelRequestForm['tapeReelRequest.reqQty'].value != '' && document.tapeReelRequestForm.runningTotal.value != '' && parseInt(document.tapeReelRequestForm.runningTotal.value) > 0 )
    {
        if(parseInt(document.tapeReelRequestForm.runningTotal.value ) > parseInt(document.tapeReelRequestForm['tapeReelRequest.reqQty'].value) )
        {
           errors = errors + "<li>Total T&R Qty Cannot be Greater than Req Qty </li>";
        }
    }*/

	if( errors != "" )
    {
        var pa = document.getElementById("errors");
        pa.innerHTML = errors;
        return false;
    }

	document.tapeReelRequestForm.action = '<%=chipTracContext%>/tapeReelRequest.do?action=save';
    document.tapeReelRequestForm.submit();
}
function checkLength(element, size)
{
    if(	element.value.length >= size )
	{
		event.returnValue = false;
	}
}

</script>
</HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" onload="calculateRunningTotal()">
<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
    <tr>
        <td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
            <!-- Side Navigation start -->
			<%
				if( user.getUserType() == 0 )
				{
			%>
            <%@ include file="/jsp/operations/releaseMenu.jsp" %>
			<%
				}
				else
				{
			%>
			<%@ include file="/jsp/admin/externaluser_menu.jsp" %>
			<%
				}	
			%>
            <!-- end of the side navigations -->
        <td bgcolor="#ffffff"><IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
        <td bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
        <td valign="top" width="100%">
            <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border="0">
            <BR>
            <html:form name="tapeReelRequestForm" type="com.scalar.chiptrack.operations.tapereel.forms.TapeReelRequestForm" action="/tapeReelRequest">
            <nested:nest property="tapeReelRequest" >
            <table border="0" width="100%" align=center>
                <tr><td colspan=5 class="NArialW" align="center">Tape Reel Request</TD></TR>
                <tr><td colspan=5>&nbsp;</td></tr>
                <tr><td colspan=5 class='NArialL'><strong><FONT id="errors" styleClass="NArialL" color='FF0000'></FONT></strong></td></tr>
                <tr>
                    <td colspan=5>
                        <chiptrack:info styleClass="NArialL" />
                        <chiptrack:errors styleClass="NArialL" />
                        <chiptrack:messages type="info" styleClass="NArialL" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <table align="center" border="0" width="100%">
                            <tr>
                                <td width="10%">&nbsp;</td>
                                <td width="15%" class="NArialL"> WO:</td>
                                <td width="20%" class="NArialL">
                                    <nested:text property="workOrderNo" size="20" maxlength="50"  styleClass="txfield" disabled="true"/>
                                    <nested:define id="tempStatus" property="reqStatus" />
                                   <!-- <bean:write name="tempStatus" /> -->
                                </td>
                                <td width="5%">&nbsp;</td>
                                <td width="15%" class="NArialL">PO:</td>
                                <td width="20%" class="NArialL">
                                     <nested:text property="poNumber" size="20" maxlength="50"  styleClass="txfield" />
                                </td>
                            </tr>
                            <tr>
                                <td width="10%">&nbsp;</td>
                                <td width="15%" class="NArialL"> TR Part Number :</td>
                                <td width="20%" class="NArialL">
                                    <nested:text property="trPartNumber" size="20" maxlength="50"  styleClass="txfield" disabled="true"/>
                                </td>
                                <td width="5%">&nbsp;</td>
                                <td width="15%" class="NArialL"> Vendor :</td>
                                <td width="20%" class="NArialL">
                                     <nested:text property="vendor" size="20" maxlength="50"  styleClass="txfield" disabled="true"/>
                                </td>
                            </tr>
                            <tr>
                                <td width="10%">&nbsp;</td>
                                <td width="15%" class="NArialL"> Package : </td>
                                <td width="20%" class="NArialL">
                                    <nested:text property="packageType" size="20" maxlength="50"  styleClass="txfield" disabled="true"/>
                                </td>
                                <td width="5%">&nbsp;</td>
                                <td width="15%" class="NArialL"> Pin Count : </td>
                                <td width="20%" class="NArialL">
                                     <nested:text property="pinCount" size="20" maxlength="50"  styleClass="txfield" disabled="true"/>
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" >&nbsp;</td>
                                <td width="15%" class="NArialL"> Reel Qty<font color=red>*</font> : </td>
                                <td width="20%" class="NArialL">
                                    <nested:text property="reelQty" size="20" maxlength="50" styleClass="valuetxfield" onkeypress="javascript:numcheck()" />
                                </td>
                                <td width="5%">&nbsp;</td>
                                <td width="15%" class="NArialL">&nbsp;</td>
                                <td width="20%" class="NArialL">&nbsp;</td>
                            </tr>
                            <tr>
                                <td width="10%" >&nbsp;</td>
                                <td width="15%" class="NArialL"> Req Qty<font color=red>*</font> : </td>
                                <td width="20%" class="NArialL">
                                    <nested:text property="reqQty" size="20" maxlength="50" styleClass="valuetxfield" onkeypress="javascript:numcheck()"/>
                                </td>
                                <td width="5%">&nbsp;</td>
                                <td width="15%" class="NArialL"> Req Date : <font color=red>*</font></td>
                                <td width="20%" class="NArialL">
                                     <nested:text property="reqDate" size="20" maxlength="50" styleClass="txfield" />
                                      <a href="javascript:openCalendar(document.tapeReelRequestForm['tapeReelRequest.reqDate'])">
                                      <img onMouseOver="window.status='Click here to select date';return true" onMouseOut="window.status='';return true" border="0" align='center'
                                      src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=17 width=17></a>
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" >&nbsp;</td>
                                <td width="15%" class="NArialL"> Exp Comp Date : </td>
                                <td width="20%" class="NArialL">
                                    <nested:text property="expCompDate" size="20" maxlength="50" styleClass="txfield" />
                                     <a href="javascript:openCalendar(document.tapeReelRequestForm['tapeReelRequest.expCompDate'])">
                                    <img onMouseOver="window.status='Click here to select date';return true" onMouseOut="window.status='';return true" border="0" align='center'
                                    src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=17 width=17></a>
                                </td>
                                <td width="5%">&nbsp;</td>
                                 <logic:equal name="tempStatus" value="Pulled">
									<td width="15%" class="NArialL"> Actual Comp Date :</td>
									<td width="20%" class="NArialL">
										 <nested:text property="actualCompDate" size="20" maxlength="50" styleClass="txfield" />
										  <a href="javascript:openCalendar(document.tapeReelRequestForm['tapeReelRequest.actualCompDate'])">
										  <img onMouseOver="window.status='Click here to select date';return true" onMouseOut="window.status='';return true" border="0" align='center'
										  src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=17 width=17></a>
									</td>
								</logic:equal>
 								<logic:equal name="tempStatus" value="Closed">	
									<td width="15%" class="NArialL"> Actual Comp Date : </td>
									<td width="20%" class="NArialL">
										 <nested:text property="actualCompDate" size="20" maxlength="50" styleClass="txfield" />
										  <a href="javascript:openCalendar(document.tapeReelRequestForm['tapeReelRequest.actualCompDate'])">
										  <img onMouseOver="window.status='Click here to select date';return true" onMouseOut="window.status='';return true" border="0" align='center'
										  src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=17 width=17></a>
									</td>
								</logic:equal>
								<logic:notEqual name="tempStatus" value="Pulled">
									<logic:notEqual name="tempStatus" value="Closed">
										<td width="15%" class="NArialL">&nbsp; </td>
										<td width="20%"class="NArialL">
											 <nested:hidden property="actualCompDate"/>
										</td>
									</logic:notEqual>
								</logic:notEqual>
                            </tr>
                            <tr>
                                <td colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td>
                            </tr>

                            <tr>
                                <td width="10%" >&nbsp;</td>
                                <td width="15%" class="NArialL">
                                <font class="NArialL"> Special Instructions : </font></td>
                                <td colspan="4" >
                                    <nested:textarea property="specialInstructions" onkeypress="javascript:checkLength(this, 1000)" styleClass="txfield" rows="5" cols="90"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td>
                            </tr>
                            <tr>
                                <td width="10%" >&nbsp;</td>
                                <td width="15%" class="NArialL">Comments :</td>
                                <td colspan="4">
                                    <nested:textarea property="comments" onkeypress="javascript:checkLength(this, 1000)" styleClass="txfield" rows="5" cols="90"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td>
                            </tr>
                            <tr>
                                <td colspan='6'>
                                    <table width="78%" align="center" cellpadding="2" cellspacing="2" border="0">
                                        <tr>
                                            <td colspan="2"><font class="NArialL">Vendor Contact Persons :</font></td>
                                         </tr>
                                        <tr>
                                            <td width="20%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <font color="#FFFFFF">Name</font>
                                            </td>
                                            <td width="20%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <FONT COLOR="#FFFFFF">EMail</FONT>
                                            </td>
                                         </tr>
                                        <nested:iterate property="vendorContactPersonsList" type="com.scalar.chiptrack.operations.release.ContactPerson" id="contactPerson" indexId="emilIteratorIdx">
                                            <tr <%if(emilIteratorIdx.intValue()%2==0){%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>>
                                                 <td width="20%" class="NArialL" align="center" nowrap>
                                                    <nested:write property="name"/>
                                                    <nested:hidden property="name"/>
                                                </td>
                                                <td width="20%" class="NArialL" align="center" nowrap>
                                                    <nested:write property="email"/>
                                                    <nested:hidden property="email"/>
                                                </td>
                                        </nested:iterate>
                                     </TABLE>
                                </td>
                             </tr>
                             <tr>
                                <td colspan="5"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td>
                            </tr>
                             <tr>
                                <td colspan='6'>
                                    <table width="78%" align="center" cellpadding="2" cellspacing="2" border="0">
                                        <tr>
                                            <td colspan="2"><font class="NArialL">&nbsp; Internal Contact Persons :</font></td>
                                         </tr>
                                        <tr>
                                            <td width="20%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <font color="#FFFFFF">Name</font>
                                            </td>
                                            <td width="20%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <FONT COLOR="#FFFFFF">EMail</FONT>
                                            </td>
                                         </tr>
                                        <nested:iterate property="contactPersonsList" type="com.scalar.chiptrack.operations.release.ContactPerson" id="contactPerson" indexId="emilIteratorIdx">
                                            <tr <%if(emilIteratorIdx.intValue()%2==0){%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>>
                                                 <td width="20%" class="NArialL" align="center" nowrap>
                                                    <nested:write property="name"/>
                                                    <nested:hidden property="name"/>
                                                </td>
                                                <td width="20%" class="NArialL" align="center" nowrap>
                                                    <nested:write property="email"/>
                                                    <nested:hidden property="email"/>
                                                </td>
                                        </nested:iterate>
                                     </TABLE>
                                </td>
                             </tr>
                            <tr>
                                <td colspan="5"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td>
                            </tr>
                            <logic:notEqual name="tempStatus" value="Create">
                            <tr>
                                <td colspan='6'>
                                    <table width="80%" align="center" cellpadding="2" cellspacing="2" border="0">
                                        <tr>
                                            <td colspan="7"><font class="NArialL">&nbsp; Lot Info:</font></td>
                                        </tr>
                                        <tr>
                                            <td width="3%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <font color="#FFFFFF">Select</font>
                                            </td>
                                            <td width="20%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <font color="#FFFFFF">FG Part Number</font>
                                            </td>
                                            <td width="20%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <font color="#FFFFFF">Lot Number</font>
                                            </td>
                                            <td width="10%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <font color="#FFFFFF">Qty Available</font>
                                            </td>
                                            <logic:notEqual name="tempStatus" value="Issued">
                                            <td width="10%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <font color="#FFFFFF">Qty Pulled</font>
                                            </td>
                                            <td width="10%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <font color="#FFFFFF">T&R Qty</font>
                                            </td>
                                            <td width="10%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <font color="#FFFFFF">Return Qty</font>
                                            </td>
											<td width="10%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <font color="#FFFFFF">Reject Qty</font>
                                            </td>
                                            </logic:notEqual>
                                            <logic:equal name="tempStatus" value="Issued">
                                            <td colspan="3" width="10%" class="NArialL" bgcolor="#993333" nowrap align="center">
                                                <font color="#FFFFFF">Qty Pulled</font>
                                            </td>
                                            </logic:equal>
                                        </tr>
                                        <%	int totalTrQty = 0;
                                            int totalPulledQty = 0;
                                            int totalReturnQty = 0;
											int totalRejectQty = 0;
                                        %>
                                        <nested:iterate property="lotList" type="com.scalar.chiptrack.operations.tapereel.TapeReelRequestLot" id="tapereelRequestLot" indexId="iteratorIdx">
                                            <tr <%if(iteratorIdx.intValue()%2==0){%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>>
                                                 <%
                                                 String jsFuntion = "setSelectAllIds(this," + iteratorIdx + ");calculateRunningTotal();";
                                                 %>
                                                <td width="3%" align="center" class='NArialL'>
                                                    <nested:checkbox property="checked" onclick="<%=jsFuntion%>"/>
                                                </td>
                                                 <td width="20%" class="NArialL" nowrap>
                                                    <nested:write property="partNumber"/>
                                                    <nested:hidden property="partNumber"/>
                                                </td>
                                                <td width="20%" class="NArialL" nowrap>
                                                    <nested:write property="lotNumber"/>
                                                    <nested:hidden property="lotNumber"/>
                                                </td>
                                                <td width="20%" align='right' class="NArialL">
                                                    <nested:write property="availableQty"/>
                                                </td>
                                                <logic:notEqual name="tempStatus" value="Issued">
													<td width="10%" align='right' class="NArialL">
														<nested:equal property="checked" value="true">
															<nested:text property="pulledQty" onkeypress="javascript:numcheck()" onkeyup="calculateRunningTotal()" styleClass="valuetxfield" maxlength="7"/>
														</nested:equal>
														<nested:notEqual property="checked" value="true">
															<nested:text property="pulledQty" onkeypress="javascript:numcheck()"  onkeyup="calculateRunningTotal()" styleClass="valuetxfield" disabled="true" maxlength="7"/>
														</nested:notEqual>
													</td>
													<td width="10%" align='right' class="NArialL">
														<nested:equal property="checked" value="true">
															<nested:text property="trQty" onkeypress="javascript:numcheck()" onkeyup="calculateRunningTotal()" styleClass="valuetxfield" maxlength="7"/>
														</nested:equal>
														<nested:notEqual property="checked" value="true">
															<nested:text property="trQty" onkeypress="javascript:numcheck()" onkeyup="calculateRunningTotal()" styleClass="valuetxfield" disabled="true" maxlength="7"/>
														</nested:notEqual>
													</td>
													<td width="10%" align='right' class="NArialL">
														<nested:equal property="checked" value="true">
															<nested:text property="returnQty" onkeypress="javascript:numcheck()" onkeyup="calculateRunningTotal()" styleClass="valuetxfield" maxlength="7"/>
														</nested:equal>
														<nested:notEqual property="checked" value="true">
															<nested:text property="returnQty" onkeypress="javascript:numcheck()" onkeyup="calculateRunningTotal()" styleClass="valuetxfield" disabled="true" maxlength="7"/>
														</nested:notEqual>
													</td>
													<td width="10%" align='right' class="NArialL">
														<nested:equal property="checked" value="true">
															<nested:text property="rejectQty" onkeypress="javascript:numcheck()" onkeyup="calculateRunningTotal()" styleClass="valuetxfield" maxlength="7"/>
														</nested:equal>
														<nested:notEqual property="checked" value="true">
															<nested:text property="rejectQty" onkeypress="javascript:numcheck()" onkeyup="calculateRunningTotal()" styleClass="valuetxfield" disabled="true" maxlength="7"/>
														</nested:notEqual>
													</td>
                                                </logic:notEqual>

                                                <logic:equal name="tempStatus" value="Issued">
													<td colspan="3" width="10%" align='right' class="NArialL">
														<nested:equal property="checked" value="true">
															<nested:text property="pulledQty" onkeypress="javascript:numcheck()" onkeyup="calculateRunningTotal()" styleClass="valuetxfield" maxlength="7"/>
														</nested:equal>
														<nested:notEqual property="checked" value="true">
															<nested:text property="pulledQty" onkeypress="javascript:numcheck()"  onkeyup="calculateRunningTotal()" styleClass="valuetxfield" disabled="true" maxlength="7"/>
														</nested:notEqual>
														<nested:hidden property="returnQty"/>
														<nested:hidden property="trQty"/>                                                    
														<nested:hidden property="rejectQty"/>
													</td>
                                                </logic:equal>
                                                <nested:hidden property="availableQty"/>
                                                <nested:hidden property="lotId"/>
                                            </tr>
                                            <%
                                                totalTrQty += tapereelRequestLot.getTrQty();
                                                totalPulledQty += tapereelRequestLot.getPulledQty();
                                                totalReturnQty += tapereelRequestLot.getReturnQty();
												totalRejectQty += tapereelRequestLot.getRejectQty();	
                                            %>
                                        </nested:iterate>
                                        <tr>
                                            <td>&nbsp;</td>
                                            <td>&nbsp;</td>
                                            <td>&nbsp;</td>
                                            <td class="NArialL">Running Totals:</td>
                                            <logic:notEqual name="tempStatus" value="Issued">
                                                <td><input type="text" name="runningTotalPulledQty" class="valuetxfield" value="<%=totalPulledQty%>" disabled="true"></td>
                                                <td><input type="text" name="runningTotalTRQty" class="valuetxfield" value="<%=totalTrQty%>" disabled="true"></td>
                                                <td><input type="text" name="runningTotalReturnQty" class="valuetxfield" value="<%=totalReturnQty%>" disabled="true"></td>
												<td><input type="text" name="runningTotalRejectQty" class="valuetxfield" value="<%=totalRejectQty%>" disabled="true"></td>
                                            </logic:notEqual>
                                            <logic:equal name="tempStatus" value="Issued">
                                                <td colspan="3">
                                                    <input type="text" name="runningTotalPulledQty" class="valuetxfield" value="<%=totalPulledQty%>" disabled="true">
                                                    <input type="hidden" name="runningTotalTRQty" value="<%=totalTrQty%>" disabled="true">
                                                    <input type="hidden" name="runningTotalReturnQty" value="<%=totalReturnQty%>" disabled="true">
													<input type="hidden" name="runningTotalRejectQty" value="<%=totalRejectQty%>" disabled="true">
                                                </td>
                                            </logic:equal>
                                        </tr>
                                        <nested:size property="lotList" id="lotListSize"/>
                                        <SCRIPT>
                                            lotNumberListSize = <%=lotListSize%>;
                                        </SCRIPT>
                                    </table>
                                </td>
                            </tr>
                            </logic:notEqual>
                            <tr>
                                <td colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td>
                            </tr>
                            <tr>
                                <td colspan="6" align=center>
                                    <input type=image border="0" src="<%=chipTracContext%>/jsp/includes/images/submit.gif" onClick ="javascript:return createRequest();" width="53" height="17" onmouseover="window.status='Click to Save Tape & Reel Request';return true" onmouseout="window.status='';return true" title="Click here to Save Tape & Reel Request">
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <a href="javascript:document.tapeReelRequestForm.reset();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17" onmouseover="window.status='Click to reset Tape & Reel Request';return true" onmouseout="window.status='';return true" title="Click here to reset Tape & Reel Request"></a>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="6"><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20></td>
                            </tr>
                        </TABLE>
                    </td>
                </tr>
            </TABLE>
            </nested:nest>
            </html:form>
        </tr>
    </TABLE>
    <!-- Footer starts here -->
    <%@ include file="/jsp/includes/footer.jsp" %>
    <!-- footer end here -->
</BODY>
</HTML>
